<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateCmcMemberLevelTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('cmc_member_level', function (Blueprint $table) {
            $table->increments('id');
            $table->integer('mer_id')->comment('商户id');
            $table->string('name')->unique()->default('')->comment('会员名称');
            $table->decimal('money')->default('0.00')->comment('购买金额');
            $table->integer('valid_date')->default('0')->comment('有效时间');
            $table->tinyInteger('is_forever')->default('1')->comment('是否为永久会员 1:永久 0 ;临时');
            $table->tinyInteger('is_pay')->default('1')->comment('是否购买,1=购买,0=不购买');
            $table->tinyInteger('is_show')->default('1')->comment('是否显示 1=显示,0=隐藏');
            $table->tinyInteger('grade')->default('0')->comment('会员等级');
            $table->decimal('discount')->default('0.00')->comment('会员享受折扣');
            $table->string('image')->default('')->comment('会员卡背景');
            $table->string('icon')->nullable()->comment('会员图标');
            $table->text('explain')->nullable()->comment('说明');
            $table->tinyInteger('is_del')->default('0')->comment('是否删除: 1:删除 0 未删除');
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('cmc_member_level');
    }
}
